package top.javai.www.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.javai.www.dao.JobAndTriggerMapper;
import top.javai.www.pojo.JobAndTrigger;
import top.javai.www.service.IJobAndTriggerService;

import java.util.List;

@Service
public class JobAndTriggerImpl implements IJobAndTriggerService {
    @Autowired
    private JobAndTriggerMapper jobAndTriggerMapper;

    /**
     * 获取定时信息
     * @param pageNum
     * @param pageSize
     * @return
     */
    @Override
    public PageInfo<JobAndTrigger> getJobAndTriggerDetails(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<JobAndTrigger> list = jobAndTriggerMapper.getJobAndTriggerDetails();
        PageInfo<JobAndTrigger> info = new PageInfo<>(list);
        return info;
    }
}
